package com.asiainfo.complier.ui;

import com.asiainfo.complier.helper.UIHelper;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
import javax.swing.border.EmptyBorder;

public class AboutUsDlg extends JDialog {

	/**
	 * AboutUsDlg
	 */
	private static final long serialVersionUID = -9071674855788263359L;

	public AboutUsDlg(JFrame parent) {
		super(parent);

		initUI();
	}

	private void initUI() {
		setTitle("java mini Complier");
		setSize(420, 260);
		setResizable(false);
		this.setLayout(new BorderLayout());

		JPanel infoPanel = new JPanel();
		infoPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10));

		JLabel authorInfo = new JLabel(
				"<html><body> Java Complier:v1.0<br/><br/> Email:hcmfys@163.com<br/><br/>tom and Jerry</body></html>");
		authorInfo.setBorder(new EmptyBorder(50, 10, 0, 10));
		infoPanel.add(authorInfo);
		JLabel logo = new JLabel();
		logo.setIcon(UIHelper.getImageIco("com/asiainfo/images/MiniUI.png"));

		this.add(logo, BorderLayout.WEST);
		this.add(infoPanel, BorderLayout.CENTER);
		JPanel btPanel = new JPanel();
		JButton btExit = new JButton(UIHelper.getResource("lan_exit"));
		btPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 10, 5));
		btExit.addActionListener(new ActionListener() {

			public void actionPerformed(ActionEvent paramActionEvent) {
				dispose();

			}
		});
		btPanel.add(btExit);
		this.add(btPanel, BorderLayout.SOUTH);
		UIHelper.centerWindow(this);

	}

	public void doModal() {
		setVisible(true);
		setModal(true);

	}
}
